package org.example.service.RedPackage;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.java.Log;
import org.example.bean.UserRedPacket;
import org.example.dao.UserRedPacketMapper;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
@Log
public class UserRedPacketServiceImpl implements UserRedPacketService {
    private final UserRedPacketMapper userRedPacketMapper;
    @Override
    public UserRedPacket findByUserIdAndActiveId(Integer userId, Integer activeId) {
        UserRedPacket userRedPacket = userRedPacketMapper.selectOne(new LambdaQueryWrapper<UserRedPacket>()
                .eq(UserRedPacket::getUser_id, userId)
                .eq(UserRedPacket::getActivity_id, activeId));
        return userRedPacket;
    }

}
